package org.example.practice.init_practice;

import lombok.extern.slf4j.Slf4j;
import org.example.service.TestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.naming.Name;

/**
 * @Author: WangShengJie
 * @Date: 2025/5/8
 */
@Component
@Slf4j
public class InitProperties {

    @Value("${parameters.properties.environment}")
    String environment;

    @Autowired
    private TestService testService;

    @PostConstruct
    public void init() {
        log.warn("初始化前====environment【{}】", environment);

        String name = "";
        String result = testService.nullDemo(name);
        System.out.println(result);

    }

}
